//
//  B_FooterPrintViewController.m
//  DreamOf
//
//  Created by 薛小刚 on 2018/8/19.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import "B_FooterPrintViewController.h"
#import "B_FooterPrintHeaderView.h"
#import "B_FooterPrintTableViewCell.h"

@interface B_FooterPrintViewController ()
@property (nonatomic, strong) BaseTableView * mainView;
@end

@implementation B_FooterPrintViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"我的足迹"];
    self.view = self.mainView;
}


- (BaseTableView *)mainView {
    if (!_mainView) {
        _mainView = [[BaseTableView alloc] init];
        [_mainView setTableViewFrameWithTop:5 left:0 right:0 bottom:0];
        [_mainView.tableView registerNib:[UINib nibWithNibName:@"B_FooterPrintTableViewCell" bundle:nil] forCellReuseIdentifier:@"B_FooterPrintTableViewCell"];
        
        
        _mainView.numberOfRowsBlock = ^NSInteger(UITableView *tableView, NSInteger section) {
            return 10;
        };
        
        _mainView.heightForHeaderBlock = ^CGFloat(UITableView *tableView, NSInteger section) {
            return 110;
        };
        _mainView.viewForHeaderBlock = ^UIView *(UITableView *tableView, NSInteger section) {
            B_FooterPrintHeaderView * header = [B_FooterPrintHeaderView initB_FooterPrintHeaderView];
            header.B_userName.text = @"易小川";
            
            return header;;
        };
        _mainView.heightForRowBlock = ^CGFloat(UITableView *tableView, NSIndexPath *indexPath) {
            return 95;
        };
        _mainView.cellForRowBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
            B_FooterPrintTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"B_FooterPrintTableViewCell" forIndexPath:indexPath];
            if (indexPath.row == 0) {
                cell.B_footerIcon.image = [UIImage imageNamed:@"B_personalcenter_footprint_sel"];
            } else {
                cell.B_footerIcon.image = [UIImage imageNamed:@"B_personalcenter_footprint_nor"];
            }
            cell.B_title.text = @"吃顿饺子可好";
            cell.B_content.text = @"皮薄馅大,肉质酥嫰!";
            return cell;
        };
        _mainView.didSelectRow = ^(UITableView *tableView, NSIndexPath *indexPath) {
            
        };
        
    }
    return _mainView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
